
package com.tbuserrolemiddlemodule.bean;

import java.io.Serializable;

import com.rolemodule.bean.TbRole;
import com.rolemodule.dao.TbRoleDAO;
import com.usersmodule.bean.TbUsers;
import com.usersmodule.dao.TbUsersDAO;

public class TbUserRoleMiddle implements Serializable{

    private int userRoleMiddleId;

    private int userId;
    private TbUsers tbUser;

    private int roleId;
    private TbRole tbRole;

    private String createTime;

    public int getUserRoleMiddleId(){
        return userRoleMiddleId;
    }

    public void setUserRoleMiddleId(int userRoleMiddleId){
        this.userRoleMiddleId = userRoleMiddleId;
    }

    public int getUserId(){
        return userId;
    }

    public void setUserId(int userId){
    	this.tbUser = new TbUsersDAO().getTbUsersByUserId(userId);
        this.userId = userId;
    }

    public int getRoleId(){
        return roleId;
    }

    public void setRoleId(int roleId){
    	this.tbRole = new TbRoleDAO().getTbRoleByRoleId(roleId);
        this.roleId = roleId;
    }

    public String getCreateTime(){
        return createTime;
    }

    public void setCreateTime(String createTime){
        this.createTime = createTime;
    }


    public TbUserRoleMiddle(){
    }
        public TbUserRoleMiddle(int userId,int roleId,String createTime){
        this.userId = userId;
        this.roleId = roleId;
        this.createTime = createTime;
    }
    public TbUserRoleMiddle(int userRoleMiddleId,int userId,int roleId,String createTime){
        this.userRoleMiddleId = userRoleMiddleId;
        this.userId = userId;
        this.roleId = roleId;
        this.createTime = createTime;
    }

	public TbUsers getTbUser() {
		return tbUser;
	}

	public void setTbUser(TbUsers tbUser) {
		this.tbUser = tbUser;
	}

	public TbRole getTbRole() {
		return tbRole;
	}

	public void setTbRole(TbRole tbRole) {
		this.tbRole = tbRole;
	}
}

